GC Agenda Case1: CMS gc Case2: OOM(off-heap)
: 98% , G1 Region . . - Mark-Sweep CMS - Mark-compact G1 CMS -XX UseCMSCompactAtFullCollection
Low Pause gc vs. Throughput gc
JVM
CMS
j vm
jvm
jvm – jdk7
OOM 1. java.lang.OutOfMemoryError : Java heap space 2. java.lang.OutOfMemoryError : Java perm space 3. Stack oom stack Linux-64 :1Mk 100 ; Windows-64 320k 32 4. 线 oom vm 线 5. java.lang.OutOfMemoryError GC overhead limit exceeded
Fullgc system.gc jmap - histo:live ( 线 ) jvisualvm gc Perm Cms gc 1. Concurrent mode failed CMS 2. Prommotion failed: Minor GC survivor space
Case 1
Case 1
Case 1
Case 1
Case 1
Case 1
Case1 1. Old background gc 2. Eden survivor space Prommotion failed: Minor GC survivor space
Case 1 oom Eden Old ygc fgc Soft reference OOM
Case 1
Case 2 - JDK/JVM DirectByteBuffer Netty DirectByteBuf / HeapByteBuf : -Xmx survivor
Case2 Fullgc vs --- fullgc * ConcurrentMap Guava TTC 32166ms/32s 47520 ms/47s Minor C/T 31/1.522 29/1 .312 Full C/T 24/23.212 36/41 .751 MapDB Ehcache TTC 40272ms/40s 30814ms/31s Minor C/T 511/0.557 297/0.430 Full C/T 0/0.000 0/0.000 LocalRedis NetworkRedis TTC 176382ms/176s 1h+ Minor C/T 421/0.415 - Full C/T 0/0.000 - : - TTC: Total Time Cost - C/T: Count/Time / (seconds)
Case2 线 FGC(Full Garbage Collection) FGC Buffer bufferPool
千丝万缕的FGC与BufferPool.docx
Case 2
Case 2 Full GC Full GC YGC CMS GC CMS GC background YGC+CMS_initMark+CMS_remark Full GC Full GC gc ygc cms gc( Full GC Full GC ygc cms gc) VMThread ygc+cms gc CMS GC foreground Foreground gc: cms gc 线 STW CMS GC . 线 [ 退 gc] Background gc background 线 old background cms gc CMS GC